package com.material.vtool.mapper;

import com.material.vtool.entity.BUserMaterialTypeEntity;
import com.material.vtool.entity.combinedEntity.HomePageMaterialTypeEntity;
import com.material.vtool.entity.combinedEntity.SimplyMaterialTypeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMaterialTypeMapper {
    List<HomePageMaterialTypeEntity> getHomePageMaterialTypeList(@Param("userId") Integer userId, @Param("miniCode") String miniCode);

    List<SimplyMaterialTypeEntity> getUserMaterialTypeByStatus(@Param("userId") Integer userId, @Param("miniCode") String miniCode, @Param("status") Integer status);

    int initializeUserMaterialType(@Param("userId") Integer userId, @Param("miniCode") String miniCode);

    Integer getUserMaterialTypeMinSort(@Param("userId") Integer userId, @Param("miniCode") String miniCode);

    BUserMaterialTypeEntity getUserMaterialTypeByMaterialTypeId(@Param("userId") Integer userId, @Param("materialTypeId") Integer materialTypeId);

    int updateUserMaterialType(BUserMaterialTypeEntity entity);

    int addUserMaterialType(BUserMaterialTypeEntity entity);

    int deleteUserMaterialType(Integer materialTypeId);

    int resortUserMaterialType(BUserMaterialTypeEntity entity);

    int deleteMaterialTypeByUserId(Integer userId);

    int insertUserMaterialType(@Param("bUserMaterialTypeEntityList") List<BUserMaterialTypeEntity> bUserMaterialTypeEntityList);

    List<Integer> getUserMaterialTypeIdList(@Param("userId") Integer userId, @Param("miniCode") String miniCode);
}
